home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Experimental BBS Explossion 3
/
Experimental BBS Explossion III.iso
/
gus
/
sdkdigv8.zip
/
SDKV8N18.TXT
< prev
next >
Wrap
Text File
|
1994-01-20
|
7KB
|
176 lines
Apparently-To: john.smith@gravis.com
GUS Programmer's Digest Thu, 20 Jan 94 4:06 Volume 8: Issue 18
Today's Topics:
Envelopes
Scaling Frequency for correct note ...
Sources on Programmers Digest
Standard Info:
- Meta-info about the GUS can be found at the end of the Digest.
- Before you ask a question, please READ THE FAQ.
----------------------------------------------------------------------
Date: Wed, 19 Jan 1994 20:32:32 -0500 (EST)
From: Phat H Tran <ptran@sciborg.uwaterloo.ca>
Subject: Envelopes
> Date: Tue, 18 Jan 1994 12:13:40 -0600 (CST)
> From: Jason William Whiteman <jww9624@tamsun.tamu.edu>
> Subject: Envelope offsets
>
> > > I am taking the envelope offset values to be an addative value (always
> > > with respect to the initial volume) unless the envelope offset is
> > > below a threshold point. Because you cannot add any positive value
> >
> > I'm not quite clear on what you're getting at. The offset is absolute,
> > not additive, as far as I'm aware.
>
> If envelope values are absolute volumes for the patch, then you
> could never set the volume of the patch playing softer or louder. If they
> were absolute volumes, then the volume would always be set at whatever
> the envelope values say.. However, we can both agree that the OVERALL
The envelope offsets are absolute when taken in isolation. I was
under the impression that we were discussing the envelope for one voice
unattenuated by factors such as channel volume and expression, and thus
couldn't make heads or tails of why you'd treat the offsets as additive.
> volume (disregarding the envelope) can be increased or decreased.
> Superimposed over this OVERALL volume are the volumes of the individual
> envelope offsets.
Since the GUS' volume is log instead of linear, with a zero volume setting
of zero and not negative infinity, I'm not sure how we'd go about attenuating
the envelope offsets. Do we substract some x from the offsets based on the
channel volume? I think this would be the way it's done for a true log scale
(i.e. one that goes to negative infinity for zero volume). For the GUS,
it's probably best to treat everything linearly, and just use the following
formula:
linoffset = chan_vol/127 * expression/127 * absoffset
logoffset = log(linoffset + 1)/log(128) * K
Logoffset would be the value we'd poke into the GUS' voice volumes and
ramp points.
Disclaimer: The above was typed in with hurried thought. Correcting
my mistakes is left as an exercise for the reader. :)
Phat.
------------------------------
Date: Wed, 19 Jan 94 09:53:50 EST
From: support@fortech.com (Technical Support)
Subject: Scaling Frequency for correct note ...
Hello,
> frequency for the GUS to play the patch at. What I would now like to know is
> how to scale the frequnecy to play say a G4 when the original sound was
> recorded at C4. Surely, the root freq and may be the sampling freq have to
> taken into consideration. Do I work it out by multiplying ( or dividing,
> which ever the case may be) the root freq by the twelfth root of two (
> 1.0594..) and working out the freq that way?
First, lets explain a couple of terms for those who don't know what they
are.
Root Frequency - Frequency of the thing recorded.
Sample Frequency - Sample Rate at which the root frequency (or tone) was
recorded.
Example:
a 1Khz tone recorded at 44.1khz would have a root freq of 1Khz and
a sample frequency of 44.1khz
First, calculate the sample ratio. There is a sample ratio for EACH
wave sample in a patch (up to 16). This must be scaled by the frequency
divisor for the # of active voices (This table is in SDK,vocfreq.c).
Adding in 1/2 the sample rate (sample>>1) is to allow for rounding.
This calulation can be done at patch load time and saved on a per-wave
basis since this will not change (unless # active voices change .... )
sample_ratio = ((ULONG)
(freq_divisor[active_voices-14]) * 512L +
(ULONG )(sample_rate>>1)) /
(ULONG )sample_rate;
Now when you are ready to do a note on, calulate the FC based on the
pre-calculated sample ratio, root freq and desired playback frequency.
USHORT Calculate_FC(unsigned int sample_ratio, long root, long frequency)
{
ULONG freq_register;
freq_register = (((ULONG)frequency * 512L) +
(ULONG)(root>>1)) /
(ULONG)root;
freq_register = ((ULONG)freq_register * 512L +
(ULONG)(sample_ratio>>1)) /
sample_ratio ;
return((USHORT)freq_register);
}
Make sure you use large enough variables (ULONG) since some of the
the intermediate values get VERY large.
Hope this helps.
Forte Tech Support
------------------------------
Date: Thu, 20 Jan 94 09:52:51 GMT
From: Flynn Peter R BSc 1 Mod Comp 93-94 <P.Flynn@teesside.ac.uk>
Subject: Sources on Programmers Digest
I thought the programmers digest would be a clinic for ailing programmers.
It would be nice if example sources were placed often.
The Gravis Developers Kit is OK but examples in C aren't really that good
to me as I am reaching all the hardware from PM386 Assembler.
I really need a better source site than ftp.uwp.edu
Speech recognition on the GUS is a problem. Not that the GUS can't do
it but because of the amount of space used to store recognition data.
A multi-user recognition package would go down a treat but until then we are
limited by the systems we are using.
Hmm :-(
Peter Flynn
SHADE
------------------------------
End of GUS Programmer's Digest V8 #18
*************************************
To post to tomorrow's digest: <gus-sdk@dsd.es.com>
To (un)subscribe or get help: <gus-sdk-request@dsd.es.com>
To contact a human (last resort): <gus-sdk-owner@dsd.es.com>
FTP sites: archive.epas.utoronto.ca /pub/pc/ultrasound
wuarchive.wustl.edu /systems/ibmpc/ultrasound
archive.orst.edu /pub/packages/gravis
theoris.rz.uni-konstanz.de /pub/sound/gus
nctuccca.edu.tw /PC/ultrasound
FTP mail server: mail-server@nike.rz.uni-konstanz.de
Hints:
- Get the FAQ from the FTP sites or the request server.
- Mail to <gus-sdk-request@dsd.es.com> for info about other GUS
related mailing lists (general use, musician's, etc.).